import instance from '@/utils/request';

export function GetAllCategory(params={}) {
    return instance.request({
    method: 'GET',
    url:'/categories',
    params
})
}

export function UploadFile(data={}) {
    return instance.request({
    method: 'POST',
    url:'/upload',
    data
})
}

export function CreateInfo(data={}) {
    return instance.request({
    method: 'POST',
    url:'/infos',
    data
})
}

export function GetInfoList(params={}) {
    return instance.request({
    method: 'GET',
    url:'/infos',
    params
})
}

export function ChangeInfoStatus(id,data={}) {
    return instance.request({
    method: 'PUT',
    url:`/infos/${id}/status`,
    data
})
}

export function DeleteInfo(id,data={}) {
    return instance.request({
    method: 'DELETE',
    url:`/infos/${id}`,
    data
})
}

export function GetInfoDetail(id,) {
    return instance.request({
    method: 'GET',
    url:`/infos/${id}`,
})
}

export function UpdateInfo(id,data=[]) {
    return instance.request({
    method: 'PUT',
    url:`/infos/${id}`,
    data
})
}